<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello React!</title>
<!-- <script src="https://cdn.staticfile.org/react/16.4.0/umd/react.development.js"></script>
<script src="https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js"></script>
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script> -->
<script src="./react.development.js"></script>
<script src="./react-dom.development.js"></script>
<script src="./babel.min.js"></script>
<script src="./prop-types.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
class Animation extends React.Component{
  constructor(props){
    super(props);
    this.state = {
      opacity:1
    }
  }
  componentDidMount(){
    console.log("componentDidMount()");
    let {opacity} = this.state;
    setInterval(()=>{
      opacity -= 0.05;
      if(opacity<0.1){
        opacity = 1;
      }
      console.log('inv')
      this.setState({opacity})
    },100)
  }
  render(){
    let {opacity} = this.state;
    return(
      <div style={{color:'red',opacity}}>www.baidu.com</div>
    )
  }
}
ReactDOM.render(<Animation />,document.getElementById('example'))
</script>
</body>
</html>